package org.reference.generic;

//import org.junit.Assert;
//import org.junit.Test;
import java.util.ArrayList;
import java.util.List;

import org.reference.generic.base.Parameter;
import org.reference.generic.base.ReferenceParameter;
import org.reference.generic.work.Job;

import util.Log;



public class Main {
	public static void main(String[] args) {
		
		Log.setType("F");
		
		Parameter param = new Parameter();

		param.addParameter(Parameter.TYPE_ARITY, "2");
		param.addParameter(Parameter.TYPE_CROSSOVER_RATE, "0.09");
		param.addParameter(Parameter.TYPE_DEPTH, "0");
		param.addParameter(Parameter.TYPE_GENE_POPULATION, "1");
		param.addParameter(Parameter.TYPE_MAX_DEPTH, "2");
		param.addParameter(Parameter.TYPE_MUTATION_RATE, "0.05");
		param.addParameter(Parameter.TYPE_REPRODUCTION_RATE, "0.05");
		param.addParameter(Parameter.TYPE_GENERATION, "5");
		
		//parameter 입력  
		
		ReferenceParameter rp = new ReferenceParameter(14,3,new Job(4), new Job(5), new Job(7), new Job(6), new Job(10), new Job(3), new Job(3), new Job(1));  //job 8개 refercmax, machien, job, job time  최적 씨맥스 14      
		//ReferenceParameter rp1 = new ReferenceParameter(10,2,new Job(2), new Job(7), new Job(10),new Job(6), new Job(7), new Job(10)); //최적 씨맥스 23, job 6
		//ReferenceParameter rp2 = new ReferenceParameter(10,3,new Job(1), new Job(3), new Job(5),new Job(4), new Job(9), new Job(10)); //최적 씨맥스 12, job 6

		
		List<ReferenceParameter> rpList = new ArrayList<ReferenceParameter>();
		
		rpList.add(rp);
		//rpList.add(rp1);
		//rpList.add(rp2);
		
		// reference parameter 입력
		int referenceCount=rpList.size();
		
		String referCount = Integer.toString(referenceCount);
		
		param.addParameter(Parameter.TYPE_REFERENCE_SIZE, referCount);
		
		GeneManager gm = new GeneManager();
		gm.init(param, rpList);
		
		Log.debug("start");
		gm.run();
		
		//gm.printResultInformation();
		Log.debug("end");		
	}

}
